
function get(url,request) {
    var xhr;
	try {
	   xhr = new ActiveXObject("Microsoft.XMLHTTP");    // Essayer Internet Explorer 
	}
	catch(e)   // Echec
	{
	  xhr = new XMLHttpRequest();  // Autres navigateurs
	}
    xhr.open('POST', url, false);
	xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xhr.send(request);
	while(xhr.readyState != 4){}
	return string2XML(xhr.responseText);
    return xhr.responseXML;
}

function send(url,request) {
    var xhr;
	try {
	   xhr = new ActiveXObject("Microsoft.XMLHTTP");    // Essayer Internet Explorer 
	}
	catch(e)   // Echec
	{
	  xhr = new XMLHttpRequest();  // Autres navigateurs
	}
    xhr.open('POST', url, true);
	xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xhr.send(request);
}

function binary2number(binary){
	var number = 0;
	for(var i = 0; i < binary.length; i++){
		number += Math.pow(2,(binary.length - i - 1)) * parseInt(binary[i]);
	}
	return number;
}

function string2XML(xml){
	try{// Internet Explorer
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  xmlDoc.async="false";
	  xmlDoc.loadXML(text);
	  }catch(e){
	  parser=new DOMParser();
	  xmlDoc=parser.parseFromString(text,"text/xml");
	  }
	return xmlDoc;
}
